package house.jc.engine.shiro.utils;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.beanutils.BeanUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import com.gitee.hermer.boot.jee.commons.bean.utils.BeanCopyUtils;
import com.gitee.hermer.boot.jee.commons.collection.CollectionUtils;
import com.gitee.hermer.engine.jars.core.xauth.domain.DynamicMenu;
import com.jc.support.auth.web.authc.Account;
import com.jc.support.user.service.DynamicMenuService;


public class SecurityUtils {
	
	public static List<DynamicMenu> getModules(){
		return com.gitee.hermer.engine.jars.app.sdk.utils.SecurityUtils.getEngineMenus();
	}

	public static Account getCurrentAccount() throws Exception{
		return com.gitee.hermer.engine.jars.app.sdk.utils.SecurityUtils.getCurrentAccount();
	}

	public static void setCurrentSessionAttribute(String key,String value){
		com.gitee.hermer.engine.jars.app.sdk.utils.SecurityUtils.setCurrentSessionAttribute(key, value);
	}
	
	public static String getCurrentSessionAttribute(String key){
		return com.gitee.hermer.engine.jars.app.sdk.utils.SecurityUtils.getCurrentSessionAttribute(key);
	}

	public static String getId() throws Exception{
		return com.gitee.hermer.engine.jars.app.sdk.utils.SecurityUtils.getId();
	}

	public static HttpServletRequest getRequest(){
		return ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
	}

}
